package com.liang.demo;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class Text {
    public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Properties prop = new Properties();

        InputStream is = Text.class.getClassLoader().getResourceAsStream("my.properties");
        prop.load(is);

        System.out.println(prop);

        String classname = prop.getProperty("classname");
        String classmethod = prop.getProperty("classmethod");

        Class aClass = Class.forName(classname);

        Object o = aClass.newInstance();
//        Object obj = new Student();
        Studnet stu = new Studnet();

        Method method = aClass.getMethod(classmethod);

        method.invoke(stu);


    }
}
